/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package practicadwh;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JWindow;
/**
 *
 * @author yojugracu
 */
public class PracticaDWH {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        new PracticaDWH();
    }
    
    public PracticaDWH(){
        //Muestra el splash
        JWindow splash = new JWindow();
        splash.setSize( 400, 300 );
        splash.setLocationRelativeTo( null );
        
        JLabel lblimagen = new JLabel( 
                new ImageIcon( 
                    getClass().getResource( "/imagenes/splash.jpg" ) 
                ) );
        
        splash.add( lblimagen );
        splash.setVisible( true );
        
        try{ Thread.sleep( 1000 ); }catch( Exception e ){ e.printStackTrace(); }
        
        //Muestra el frame principal
        /*ventana principal = new ventana();
        principal.setVisible( true );*/
        Principal pin = new Principal();
        pin.setVisible(true);
        //Oculta el splash
        splash.setVisible( false );
        
        /*Conexion.setUsuario("postgres", "yojugracu");
        Connection con = Conexion.getConexion("prueba");
        
        
        DML.getRelacionTabla(con, "cliente");
        DML.selectAll( con, "RUBRO");
        String[] s = DML.getTablas(  con );
        for( String s1 : s ){
            System.out.println( s1 );
        }
        
        ArrayList<String[]> campos = DML.getCamposTabla(con,"ciudad");
        
        for( int i = 0 ; i < campos.size() ; i++ ){
            String[] campo = campos.get(i);
            System.out.println( campo[0] + " - " + campo[1] );
        }
        
        ArrayList<String[]> campos = DML.getCamposTabla(con,"cliente");
        Tablas t = new Tablas();
        
        JFrame f = new JFrame();
        f.setDefaultCloseOperation( JFrame.HIDE_ON_CLOSE);
        f.setLayout( new BorderLayout() );
        JScrollPane sp = new JScrollPane();
        f.add( sp, BorderLayout.CENTER );
        t.addTabla("cliente", new String[]{ "Nombre", "Tipo" } );
        t.addFilas("cliente", campos);
        sp.setViewportView( t.getTabla("cliente") );
        f.setSize(200,200);
        f.setLocationRelativeTo(null);
        f.setVisible( true );
        */
    }
}
